home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batmakr2.zip / BATMAKER.DOC < prev    next >
Text File  |  1990-01-01  |  5KB  |  115 lines

  1. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. BATMAKER                               An MS-DOS Utility by  Robert L. Miller
  3. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  4.  
  5.      The BATMAKER utility is a convenience tool which makes batch files.   The 
  6. idea is based on a CP/M-80 program called FMAP.COM, originally written by Ward 
  7. Christensen,  which I have found useful over the years.   BATMAKER will run on 
  8. ANY  MSDOS  2.x  system,  and  it has a number of  different  output  options, 
  9. tailored to MSDOS.
  10.      BATMAKER  reads  file names from a disk directory and puts them  into  an 
  11. output batch file called NAMES.BAT.   This batch file may then be run like any 
  12. other  batch  file,  using command line arguments to fill in  the  replaceable 
  13. parameter %1, %2, etc.
  14.      The  format  of NAMES.BAT can be any one of a  number  of  possibilities, 
  15. depending  on which option letter is used.   To see how to run it,  just  type 
  16. BATMAKER with no command line arguments:
  17.  
  18. BATMAKER version 2.00 R. L. Miller
  19.  
  20. Usage:  BATMAKER Filename.Typ -0)ption Letter
  21.  
  22. Option Letter  Output
  23. =============  ======
  24.      -A        %1 Filename.Typ %2 %3
  25.      -B        %1 %2 Filename.Typ %3 %4
  26.      -C        %1 %2Filename.Typ %3 %4
  27.      -D        %1 <Filename.Typ >%2 %3
  28.      -E        %1 <Filename.Typ >>%2 %3
  29.      -F        %1 <Filename.Typ |%2 >%3 %4
  30.      -G        %1 <Filename.Typ |%2 >>%3 %4
  31.      -H        -- Prints this help message --
  32.      -I        %1 %2 %3 Filename.Typ %4 %5
  33.  -any other    Filename.Type
  34.  
  35. Output for all options but -H go to file NAMES.BAT in current directory
  36. Command line can handle paths, e.g.:
  37.                A>BATMAKER B:\BIN\*.COM -A
  38.  
  39.  
  40.      Each  output tupe has different possible uses.   For example,  option  -A 
  41. might be used with the COPY command.  Suppose we did this:
  42.           A>BATMAKER *.COM -A
  43.  
  44.      The  BATMAKER utility would read in all .COM files in the current direct
  45. ory, sort them into alphabetical order, and spit them out into our file called 
  46. NAMES.BAT.  At this point, NAMES.BAT might look like this:
  47.           A> TYPE NAMES.BAT
  48.           %1 TURBO.COM %2 %3
  49.           %1 MAKEBAT.COM %2 %3
  50.           %1 TFLOAT.COM %2 %3
  51.           A>
  52.  
  53.      We could now run NAMES.BAT like this:
  54.           A>NAMES COPY C: -V
  55. and MSDOS would substitute the word "COPY" for replacement parameter  %1, "C:" 
  56. for %2,  and "-V" for %3.  Thus, the screen would show MSDOS doing the follow
  57. ing 3 commands:
  58.           A>COPY TURBO.COM C: -V
  59.           A>COPY MAKEBAT.COM C: -V
  60.           A>COPY TFLOAT.COM C: -V
  61.           A>
  62.  
  63.      (On my system,  I have set the "switch character" to dash ["-"].  On many 
  64. other systems it is a slash ["/"], so those people would make parameter %3 the 
  65. string "/V".)
  66.  
  67.      We  might  think  of MSDOS command lines as sentences which  have  nouns, 
  68. verbs,  and  modifiers.   In  the  example above,  "COPY" acts  like  a  verb, 
  69. "TFLOAT.COM"  acts  like a noun,  and the others are sort of  like  modifiers.  
  70. Most  examples of batch files that you see put the parameters in the positions
  71. where  the "nouns" could go,  and the "verbs" are explicitly  typed  out.   An 
  72. example of that type could be used to assemble and link programs:
  73.           A> TYPE ASSEMBLE.BAT
  74.           MASM %1,%1,%1,,
  75.           LINK %1,%1,,,
  76.           EXE2BIN %1.EXE %1.COM
  77.           DEL %1.EXE
  78.           A>
  79.  
  80.      NAMES.BAT is just the opposite.  It supplies the "nouns" as explicit file 
  81. names which it gets from a disk directory,  but leaves the variable parameters 
  82. as place markers for the verbs you will fill in later when you use it.
  83.  
  84.      We still have our copy of NAMES.BAT on drive A, so we can use it again:
  85.           A>NAMES DEL
  86. which causes MSDOS to do this:
  87.           A>DEL TURBO.COM
  88.           A>DEL MAKEBAT.COM
  89.           A>DEL TFLOAT.COM
  90.           A>
  91.  
  92.      This  is just a reminder to show you that,  if you don't supply all  the 
  93. parameters  in the command line,  MSDOS just puts blanks where the  unsupplied
  94. parameters would go.
  95.  
  96.      I have tried to supply a lot of options for the format of NAMES.BAT.   In
  97. addition  to sticking several parameters at the end of the line, which you may
  98. or  may not use,  I have included options which do  input/output  redirection,
  99. appending to a file, and piping.
  100.  
  101.      Frankly,  though, I'm not sure if I supplied ENOUGH options, or the RIGHT
  102. KIND of options.   If there's a useful option I have left out,  I'd appreciate
  103. hearing from you, even if you add it yourself.
  104.  
  105.      I  am  releasing  the executable file and the source code to  the  public 
  106. domain.   The program is written in Turbo Pascal,  version 3.0.   There is one 
  107. catch,   however.   The  directory  sort uses routines in the  Turbo  Database 
  108. Toolbox,  which  I  cannot give out.    Therefore,   you must also have  Turbo 
  109. Database Toolbox in order  to recompile BATMAKER.
  110.  
  111.                     Robert L. Miller
  112.                     12810 Chesney Lane
  113.                     Bowie, MD 20715
  114.  
  115.